import Vue from 'vue'
import VueRouter from 'vue-router'

// 导入组件
import Login from '@/views/login'
import Layout from '@/views/layout'
import NotFound from '@/views/404'

// 导入二级路由
import Home from '@/views/layout/home'
import QA from '@/views/layout/qa'
import Video from '@/views/layout/video'
import User from '@/views/layout/user'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children:[
      path:'home',
      component:'Home'
    ]
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/*',
    component: NotFound
  }
]

const router = new VueRouter({
  routes
})

export default router
